// @ts-ignore
/* eslint-disable */
import request from "@/utils/http";

/** 查询全部菜单 GET /api/menu */
export async function getAllMenusQuery(options?: { [key: string]: any }) {
  return request<Api.Result1IEnumerable1MenuDto>("/api/menu", {
    method: "GET",
    ...(options || {}),
  });
}

/** 创建菜单 POST /api/menu */
export async function createMenu(
  body: Api.CreateMenuCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Guid>("/api/menu", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除菜单 DELETE /api/menu */
export async function batchDeleteMenu(
  body: Api.BatchDeleteMenuCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/menu", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改菜单 PUT /api/menu/${param0} */
export async function updateMenu(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.updateMenuParams,
  body: Api.UpdateMenuCommand,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1Boolean>(`/api/menu/${param0}`, {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 克隆菜单 POST /api/menu/clone */
export async function cloneMenu(options?: { [key: string]: any }) {
  return request<Api.Result1Boolean>("/api/menu/clone", {
    method: "POST",
    ...(options || {}),
  });
}

/** 获取当前用户菜单 GET /api/menu/me */
export async function getMeMenus(options?: { [key: string]: any }) {
  return request<Api.Result1IEnumerable1MenuDto>("/api/menu/me", {
    method: "GET",
    ...(options || {}),
  });
}
